package com.imooc.articles_mongodb_project.dto;

import com.imooc.articles_mongodb_project.common.validator.SaveValidator;
import com.imooc.articles_mongodb_project.common.validator.UpdateValidator;
import lombok.Data;

import javax.validation.constraints.NotBlank;

@Data
public class ArticleDTO {

    @NotBlank(message = "id不能为空", groups = {UpdateValidator.class})
    private String id;

    @NotBlank(message = "标题不能为空", groups = {SaveValidator.class})
    private String title;
    @NotBlank(message = "作者不能为空", groups = {SaveValidator.class})
    private String authName;
    @NotBlank(message = "内容不能为空", groups = {SaveValidator.class})
    private String content;
}
